\(\int (A+C \cos ^2(c+d x)) \sec ^2(c+d x) \, dx\) [12]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 15 \[ \int \left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=C x+\frac {A \tan (c+d x)}{d} \]

[Out]

C*x+A*tan(d*x+c)/d

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3091, 8} \[ \int \left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\frac {A \tan (c+d x)}{d}+C x \]

[In]

Int[(A + C*Cos[c + d*x]^2)*Sec[c + d*x]^2,x]

[Out]

C*x + (A*Tan[c + d*x])/d

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3091

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[A*Cos[e +
 f*x]*((b*Sin[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Dist[(A*(m + 2) + C*(m + 1))/(b^2*(m + 1)), Int[(b*Sin[e
+ f*x])^(m + 2), x], x] /; FreeQ[{b, e, f, A, C}, x] && LtQ[m, -1]

Rubi steps \begin{align*} \text {integral}& = \frac {A \tan (c+d x)}{d}+C \int 1 \, dx \\ & = C x+\frac {A \tan (c+d x)}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00 \[ \int \left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=C x+\frac {A \tan (c+d x)}{d} \]

[In]

Integrate[(A + C*Cos[c + d*x]^2)*Sec[c + d*x]^2,x]

[Out]

C*x + (A*Tan[c + d*x])/d

Maple [A] (verified)

Time = 2.78 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.40

method result size
derivativedivides \(\frac {A \tan \left (d x +c \right )+C \left (d x +c \right )}{d}\) \(21\)
default \(\frac {A \tan \left (d x +c \right )+C \left (d x +c \right )}{d}\) \(21\)
parts \(\frac {A \tan \left (d x +c \right )}{d}+\frac {C \left (d x +c \right )}{d}\) \(23\)
risch \(C x +\frac {2 i A}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}\) \(25\)
parallelrisch \(\frac {\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) x d C -d x C -2 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) \(53\)
norman \(\frac {C x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+C x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-C x -\frac {2 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {4 A \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 A \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-C x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) \(129\)

[In]

int((A+C*cos(d*x+c)^2)*sec(d*x+c)^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(A*tan(d*x+c)+C*(d*x+c))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 31 vs. \(2 (15) = 30\).

Time = 0.25 (sec) , antiderivative size = 31, normalized size of antiderivative = 2.07 \[ \int \left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\frac {C d x \cos \left (d x + c\right ) + A \sin \left (d x + c\right )}{d \cos \left (d x + c\right )} \]

[In]

integrate((A+C*cos(d*x+c)^2)*sec(d*x+c)^2,x, algorithm="fricas")

[Out]

(C*d*x*cos(d*x + c) + A*sin(d*x + c))/(d*cos(d*x + c))

Sympy [F]

\[ \int \left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\int \left (A + C \cos ^{2}{\left (c + d x \right )}\right ) \sec ^{2}{\left (c + d x \right )}\, dx \]

[In]

integrate((A+C*cos(d*x+c)**2)*sec(d*x+c)**2,x)

[Out]

Integral((A + C*cos(c + d*x)**2)*sec(c + d*x)**2, x)

Maxima [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.33 \[ \int \left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\frac {{\left (d x + c\right )} C + A \tan \left (d x + c\right )}{d} \]

[In]

integrate((A+C*cos(d*x+c)^2)*sec(d*x+c)^2,x, algorithm="maxima")

[Out]

((d*x + c)*C + A*tan(d*x + c))/d

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.33 \[ \int \left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\frac {{\left (d x + c\right )} C + A \tan \left (d x + c\right )}{d} \]

[In]

integrate((A+C*cos(d*x+c)^2)*sec(d*x+c)^2,x, algorithm="giac")

[Out]

((d*x + c)*C + A*tan(d*x + c))/d

Mupad [B] (verification not implemented)

Time = 0.83 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.13 \[ \int \left (A+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\frac {A\,\mathrm {tan}\left (c+d\,x\right )+C\,d\,x}{d} \]

[In]

int((A + C*cos(c + d*x)^2)/cos(c + d*x)^2,x)

[Out]

(A*tan(c + d*x) + C*d*x)/d